<extend name="Public/base"/>

<block name="body">
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>

    <div class="main-title">
        <h2><if condition="ACTION_NAME eq 'child'">
        设置【{$match}】的比赛
        <else/>
        编辑比赛 
        </if>
        <button class="btn btn-default btn-return" onclick="javascript:history.back(-1);return false;"><i class="glyphicon glyphicon-share-alt"></i> 返 回</button>
        </h2>
    </div>

    <div class="tab-wrap">
        <ul class="tab-nav nav nav-tabs">
            <li data-tab="tab1" class="current"><a href="javascript:void(0);">基本</a></li>
            <li data-tab="tab2"><a href="javascript:void(0);">印章</a></li>
        </ul>
    </div>

    <div class="tab-content">
    <form action="" method="post" class="form">
    <div id="tab1" class="tab-pane in tab1">
        <div class="form-item form-group">
            <label class="item-label">标题<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text form-control input-large" name="title" value="{$data.title|htmlspecialchars_decode}">
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">赛事日期<span class="check-tips">如:2015-05-01</span></label>
            <div class="controls">
                <input type="text" class="text form-control input-mini time" name="match_time" 
                <notempty name="data.match_time"> value="{$data.match_time|date="Y-m-d",###}"</notempty>
                placeholder="赛事日期">
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">比赛时间<span class="check-tips">如:09:00</span></label>
            <div class="controls">
                <input type="text" class="text form-control input-mini" name="match_hour" value="{$data.match_hour}" placeholder="00:00">
            </div>
        </div>
        <div class="form-item form-group cf">
            <label class="item-label">封面<span class="check-tips"></span></label>
            <div class="controls">
                <div class="controls">
                    <input type="file" id="upload_picture_thumb">
                    <input type="hidden" name="thumb" id="cover_id_thumb" value="{$data.thumb}" />
                    <div class="upload-img-box">
                        <notempty name="data.thumb">
                        <div class="upload-pre-item"><img src="__ROOT__{$data.thumb}"/></div>
                        </notempty>
                    </div>
                </div>
                {:hook('adminPicUpload', array('id'=>"upload_picture_thumb",'return'=>"cover_id_thumb", 'type' => 'path'))}                                                              
            </div>
        </div>

        <div class="form-item form-group form-inline">
            <label class="item-label">队伍<span class="check-tips"> ( 填写队伍名称 ) </span></label>
            <div class="controls">
                队伍1: <input class="text form-control input-small" name="fJoiner" value="{$data.competitor.0|htmlspecialchars_decode}">
                VS
                队伍2: <input class="text form-control input-small" name="sJoiner" value="{$data.competitor.1|htmlspecialchars_decode}">
            </div>
        </div>

        <div class="form-item form-group">
            <label class="item-label">胜负比<span class="check-tips">如:1-1(英文"-")</span></label>
            <div class="controls">
                <input type="text" class="text form-control input-mini" name="score" value="{$data.score}">
            </div>
        </div>

        <div class="form-item form-group">
            <label class="item-label">人头比<span class="check-tips">如:16-05(英文"-")</span></label>
            <div class="controls">
                <input type="text" class="text form-control input-mini" name="score_point" value="{$data.score_point}">
            </div>
        </div>

        <div class="form-item form-group">
            <label class="item-label">描述<span class="check-tips"></span></label>
            <div class="controls">
                <label class="input-large">
                    <textarea class="form-control" rows="4" name="detail">{$data.detail}</textarea>
                </label>
            </div>
        </div>
        </div>
        <div id="tab2" class="tab-pane tab2">
            <ul class="pic_ul">
            <volist name="iconsOptions" id="ic">
                <li>
                    <label>
                    <input class="ids" <if condition="in_array($ic['id'], $data['icons'])">checked</if> type="checkbox" name="icons[]" value="{$ic.id}" />
                    <img alt="{$ic.name|htmlspecialchars_decode}" title="{$ic.name|htmlspecialchars_decode}" src="__ROOT__{$ic.pic}" width="60" height="60" />
                    </label>
                    <div class="title">{$ic.name|htmlspecialchars_decode}</div>
                </li>
            </volist>
            </ul>
            <div class="clear"></div>
        </div>

        <br><br>
        <div class="form-item form-group form-action">

            <input type="hidden" name="match_id" value="{$id}">
            <input type="hidden" name="game_id" value="{$game}">
            <button class="btn submit-btn ajax-post btn-success btn-block" id="submit" type="submit" target-form="form">确 定</button>
            <!-- <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button> -->
        </div>
    </form>
    </div>
</block>

<block name="script">
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>

    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('Game/index')}');
        showTab();
        $(function(){
            $('.time').datetimepicker({
                format: 'yyyy-mm-dd',
                language:"zh-CN",
                minView:2,
                autoclose:true
            });
        });
       
    </script>
</block>
